<html>
    <head>
        <title>Acesso para Loja - Cia Soft</title>
        <script>
        function validacampos(){
            var ok = true;
            
            if (document.getElementById('j_username').value == ""){
                document.getElementById('msgLogin').style.display = "inline";
                ok = false;
            }else{
                document.getElementById('msgLogin').style.display = "none";
            }

            if (document.getElementById('j_password').value == ""){
                document.getElementById('msgSenha').style.display = "inline";
                ok = false;
            }else{
                document.getElementById('msgSenha').style.display = "none";
            }

            return ok;
        }

        function onKeyPress() {
            var oEvent = (window.event) ? window.event : evt;
            nKeyCode =  oEvent.keyCode ? oEvent.keyCode : oEvent.which ? oEvent.which : void 0;
            //alert(nKeyCode); Enter (13)
            if(nKeyCode == 13){
                validacampos();
            }
        }

        </script>
        <style type="text/css">
        .texto {
            font-family:  Arial, Helvetica, sans-serif;
            font-size: 12px;
            font-style: normal;
            font-weight: lighter;
            font-variant: normal;
            text-decoration:none;
            color: #385376;
        }
        .caixatexto {
            font-family:  Arial, Helvetica, sans-serif;
            font-size: 12px;
            font-weight: normal;
            color: #385376;
        }
        </style>
    </head>
    <br>
    <body onLoad="return document.getElementById('j_username').focus();" background="_images/fundo.gif">
        <form name=frmAcesso id=frmAcesso action="j_security_check" onsubmit="return validacampos();" method=post>
            <table style="width:100%;height:60%;" border="0" cellpadding="0" cellspacing="0">
                <tr valign="middle" style="width:100%;">
                    <td>
                        <table align="center">
                           <tr>
                                <td valign="top">
                                    <img src="_images/fundo_acesso.png" border="0">
                                </td>
                           </tr>
                           <tr>
                                <td valign="top">
                                    <table cellpadding="2" cellspacing="2" border="0">
                                        <tr style="heigth:20px">
                                            <td class="texto"><b>Login:</b></td>
                                            <td><input type=text name=j_username id=j_username class=caixatexto size=20 onkeypress="onKeyPress();"></td>
                                        </tr>
                                        <tr style="heigth:20px">
                                            <td class="texto"><b>Senha:</b></td>
                                            <td><input type=password name=j_password id=j_password class=caixatexto size=20 onkeypress="onKeyPress();"></td>
                                            <td><input type="submit" value="Ok"></td>
                                        </tr>
                                        <tr>
                                            <td colspan="3" class="texto" align="center">
                                                <font id="msgLogin" color="#ff4040" style="display:none;">Login n&atilde;o informado.</font>&nbsp;<br>
                                                <font id="msgSenha" color="#ff4040" style="display:none;">Senha n&atilde;o informada.</font>&nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="3" class="texto" align="center">
                                                &nbsp;<br>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </form>
    </body>
</html>